<!-- 即将上映-->
<template>
  <div>
    <sn-row-has-two-col
        class="margin-bottom"
        :left="21" :right="3">
      <div slot="one-col" class="to-flex">
        <sn-text
            :font-size="25"
            font-color="#2D98F3"
            text="即将上映（"/>
        <sn-text
            :font-size="25"
            font-color="#2D98F3"
            text="9"/>
        <sn-text
            :font-size="25"
            font-color="#2D98F3"
            text=" 部）"/>
      </div>
      <el-link
          :underline="false"
          @click="toWillOnMovie"
          type="primary"
          slot="two-col">
        <sn-text
            :move-down="7"
            :font-size="20"
            text="全部 >"/>
      </el-link>
    </sn-row-has-two-col>
    <will-on-row :will-on-row-data="firstRow"/>
    <will-on-row :will-on-row-data="secondRow"/>
  </div>
</template>

<script>
import WillOnRow from "@/views/home/left/will_on/WillOnRow";

export default {
  name: "WillOn",
  components: {
    WillOnRow
  },
  data() {
    return {
      firstRow: [],
      secondRow: []
    }
  },
  methods: {
    toWillOnMovie() {
      this.$router.push({
        name: 'movieList',
        params: {
          beOnStatus: 2
        }
      })
    },
    getWillOnData() {
      this.$http({
        url: '/web/movie/index/getUpcomingShow',
        method: 'get',
        params: this.$http.adornParams({
          'page': '1',
          'limit': '8',
        })
      }).then(({data}) => {
        let willOnData = data.data

        this.firstRow.push(willOnData[0])
        this.firstRow.push(willOnData[1])
        this.firstRow.push(willOnData[2])
        this.firstRow.push(willOnData[3])
        this.secondRow.push(willOnData[4])
        this.secondRow.push(willOnData[5])
        this.secondRow.push(willOnData[6])
        this.secondRow.push(willOnData[7])
      })
    },
  },
  created() {
    this.getWillOnData()
  }
}
</script>

<style scoped>

</style>
